/*  ----------------------------------------------------------------------------
 *  Arello Mobile
 *  Fast 3d Engine
 *  ----------------------------------------------------------------------------
 * Except where otherwise noted, this work is licensed under
 * http://creativecommons.org/licenses/by/3.0
 */
#pragma once

#include <Config.h>
#include <lib3d/node/Node.h>
#include <animate/Soul.h>
#include <CompilerFeatures.h>

namespace liba {
namespace lib3d {
namespace node {

class SoundListener :
	public Node,
	public animate::Soul
{
public:
	static const Atom node_name;

	SoundListener( const Atom & name, Node * parent );

	virtual void LifeCycle(time_float delta_time) LIBA_OVERRIDE;

	static void set_active_listener( Node * listener );
	static bool is_listening( Node * sound );
protected:
	virtual bool on_attribute( xml::Provider * prov, const std::string & name, const std::string & value );
private:
	void update_position(double delta_time);
	static WowPtr<Node> active_listener;
	Vector last_pos;
///	double distance_factor;
};

} // node
} // namespace lib3d
} // namespace liba